import {post,get} from '../utils/request'
//管理员列表
interface Data {
    page:string
    pageSize:string
    idorname ?:string
}
const Adlists = <Data>  (data:Data) =>{
    return get('api/visit/admin/list',data)
}

//启用/不启用管理员
interface Cdata {
    admin_id:number
    is_use:number
}
const Changestatus  = (data:Cdata) => {
    return post("api/visit/admin/changestatus",data)
}

//删除管理员
interface Dlem {
    admin_id:number | Array<number>
}
const Deladmin= <Dlem> (admin_id:Dlem) =>{
    return get("api/visit/admin/del",admin_id)
}

//添加管理员
const Addadmin = (data:any) => {
    return post("api/visit/admin/add",data)
}
//部门列表
const Department = () => {
    return get("api/visit/department/list",{})
}
//根据id获取单挑信息
const IDinfo = (id:any) =>{
    return  get("api/visit/admin/show",id)
}

//修改
const Updata = (data:any) => {
    return post("visit/admin/edit",data)
}

export {
    Adlists,
    Changestatus,
    Deladmin,
    Addadmin,
    Department,
    Updata,
    IDinfo
}